using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dune.Business.Domain.Content;
using Edge.Common;
using Edge.Common.Services;
using SortDirection=Edge.Common.SortDirection;

namespace Dune.Web.Controls.Dashboard
{
    public partial class LastNews : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            FetchOptions fo = FetchOptions.All;
            fo.SortExpression = "CreateDate";
            fo.SortDirection = SortDirection.Descending;

            NewsFilter nf = new NewsFilter();
            nf.RegisterDateFrom = DateTime.Now.Date;

            rprNews.DataSource = Locator.GetService<INewsManager>().Find(fo, nf);
            rprNews.DataBind();
        }
    }
}